package com.jingtai.platform.controller.shop;

import com.jingtai.core.entity.shop.ShufflingFigure;
import com.jingtai.platform.service.shop.ShufflingFigureService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 轮播图表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/shufflingfigure")
@Api(tags = "轮播图表")
public class ShufflingFigureController{

    @Autowired
    private ShufflingFigureService shufflingFigureService;


    @ApiOperation("轮播图表列表查询")
    @GetMapping("/list")
    public ResultUtil aopShufflingFigureList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return shufflingFigureService.ShufflingFigurelist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询shufflingFigure实体")
    @GetMapping("/getShufflingFigureById")
    public ResultUtil GetShufflingFigureById(@CApiParam(name = "id",value = "shufflingFigure实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return shufflingFigureService.getShufflingFigureById(id);
    }


    @ApiOperation("新增shufflingFigure实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"shufflingFigure.id","shufflingFigure.createTime","shufflingFigure.updateTime","shufflingFigure.deleteFlag"})
    public ResultUtil aopAddShufflingFigure(@RequestBody @Validated ShufflingFigure shufflingFigure){
        return shufflingFigureService.addShufflingFigure(shufflingFigure);
    }

    @ApiOperation("编辑shufflingFigure实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"shufflingFigure.createTime","shufflingFigure.updateTime","shufflingFigure.deleteFlag"})
    public ResultUtil aopEditShufflingFigure(@RequestBody @Validated ShufflingFigure shufflingFigure){
        return shufflingFigureService.editShufflingFigure(shufflingFigure);
    }

    @ApiOperation("根据ID删除shufflingFigure实体")
    @GetMapping("/delShufflingFigureById")
    public ResultUtil aopDelShufflingFigureById(@CApiParam(name = "id",value = "shufflingFigure实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return shufflingFigureService.delShufflingFigureById(id);
    }

}






